perm filename CH.DIF[MF,ALS] blob sn#800355 filedate 1985-09-05 generic text, type T, neo UTF8
  1) DVIESP.CH[TEX,SYS] and 2) DVIIMP.CH[MF,ALS]	9-05-85 10:04	pages 1,1

**** File 1) DVIESP.CH[TEX,SYS]/1P/1L
1)	COMMENT ⊗   VALID 00012 PAGES
1)	C REC  PAGE   DESCRIPTION
**** File 2) DVIIMP.CH[MF,ALS]/1P/1L
2)	COMMENT ⊗   VALID 00008 PAGES
2)	C REC  PAGE   DESCRIPTION
***************


**** File 1) DVIESP.CH[TEX,SYS]/1P/5L
1)	C00003 00003	@x Printing goes to terminal
1)	C00004 00004	@x Specify compiler directives:
1)	C00005 00005	@x Opening packed binary files:
1)	C00012 00006	@x Set up terminal I/O:
1)	C00014 00007	@x The default font directory:
1)	C00016 00008	@x Change to file name conventions:
1)	C00020 00009	@x Change to tfm file name conventions:
1)	C00024 00010	@x user and file id
1)	C00028 00011	@x esp
1)	C00029 00012	@x file_name type
1)	C00031 ENDMK
1)	C⊗;
**** File 2) DVIIMP.CH[MF,ALS]/1P/5L
2)	C00003 00003	@x
2)	C00005 00004	@x Opening packed binary files:
2)	C00007 00005	@x Set up terminal I/O:
2)	C00009 00006	@x The default font directory:
2)	C00011 00007	@x Change to file name conventions:
2)	C00016 00008	@x user and file id
2)	C00019 ENDMK
2)	C⊗;
***************


**** File 1) DVIESP.CH[TEX,SYS]/3P/1L
1)	@x Printing goes to terminal
1)	@d print(#)==write(#)
1)	@d print_ln(#)==write_ln(#)
1)	@d print_nl==write_ln
1)	@y
**** File 2) DVIIMP.CH[MF,ALS]/3P/1L
2)	@x
2)	@d print(#)==write(#)
2)	@d print_ln(#)==write_ln(#)
2)	@y
***************


  1) DVIESP.CH[TEX,SYS] and 2) DVIIMP.CH[MF,ALS]	9-05-85 10:04	pages 3,3

**** File 1) DVIESP.CH[TEX,SYS]/3P/8L
1)	@d print_nl==write_ln(tty)
1)	@z
1)	@x Specify compiler directives:
1)	@p program DVI_IMP(@!dvi_file,@!im_file,@!output);
1)	@y
1)	@p @t\4@>@{$D+,W+@} {no debugging overhead}
1)	program DVI_IMP;
1)	@z
**** File 2) DVIIMP.CH[MF,ALS]/3P/7L
2)	@z
2)	@x Specify compiler directives:
2)	@p program DVI_IMP(@!dvi_file,@!im_file@!output);
2)	@y
2)	@p @t\4@>@{$D+,W+@} {no debugging overhead}
2)	program DVI_IMP(@!dvi_file,@!im_file);
2)	@z
***************


**** File 1) DVIESP.CH[TEX,SYS]/5P/11L
1)	@#
1)	procedure open_tfm_file; {prepares to read packed bytes in |tfm_file|}
1)	begin reset(tfm_file,cur_tfm_name);
1)	end;
1)	@y
1)	@p procedure esp(var dvi_file,im_file:f@&i@&l@&e); extern; @t\2@>@/
1)		{spools the |im_file| under the |dvi_file| name}
1)	@#
1)	function rescan:boolean; extern; @t\2@>@;
1)		{puts the command line into the terminal buffer,
1)		or returns |false| if there was no command line}
1)	@#
1)	procedure cur_nam(var chan:f@&i@&l@&e;var s:string); extern; @t\2@>@/
1)	@#
1)	function erstat(var f:file):integer; extern;@t/2@>
1)	@#
1)	procedure open_dvi_file; {prepares to read packed bytes in |dvi_file|}
1)	label 223;
1)	var i:integer;
1)	@!seen_dot, @!seen_left_bracket, @!seen_right_bracket: boolean;
1)	@!seen_slash: boolean;
1)	begin
1)	if rescan then begin
1)		read_ln(tty);
1)		while (¬ eoln(tty))∧(tty↑≠';') do get(tty);
1)		end;
1)	if eoln(tty) then write(tty,'DVI file? ');
  1) DVIESP.CH[TEX,SYS] and 2) DVIIMP.CH[MF,ALS]	9-05-85 10:04	pages 5,4

1)	223:
1)	i←1;
1)	get(tty);
1)	seen_dot←false; seen_left_bracket←false; seen_right_bracket←false;
1)	seen_slash←false;
1)	while (¬ eoln(tty)) and (not seen_slash) do begin
1)		if tty↑='.' then seen_dot←true
1)		else if tty↑=']' then seen_right_bracket←true
1)		else if tty↑='[' then begin
1)			if not seen_dot then begin
1)				seen_dot←true;
1)				dvi_name[i]←'.'; incr(i);
1)				dvi_name[i]←'D'; incr(i);
1)				dvi_name[i]←'V'; incr(i);
1)				dvi_name[i]←'I'; incr(i);
1)				end;
1)			seen_left_bracket←true
1)			end;
1)		if tty↑='/' then seen_slash←true
1)		else begin dvi_name[i]←tty↑; incr(i); get(tty); end;
1)		end;
1)	if not seen_dot then begin
1)		dvi_name[i]←'.'; incr(i);
1)		dvi_name[i]←'D'; incr(i);
1)		dvi_name[i]←'V'; incr(i);
1)		dvi_name[i]←'I'; incr(i);
1)		end;
1)	if seen_left_bracket and not seen_right_bracket then begin
1)		dvi_name[i]←']'; incr(i);
1)		end;
1)	spoolit←true;
1)	while (seen_slash) and (¬ eoln(tty)) do begin
1)	    get(tty);
1)	    if (tty↑='c') or (tty↑='C') then read_c
1)	    else if (tty↑='f') or (tty↑='F') then read_f
1)	    else if (tty↑='n') or (tty↑='N') then read_n
1)	    else if (tty↑='h') or (tty↑='H') then read_h
1)	    else if (tty↑='v') or (tty↑='V') then read_v
1)	    else if (tty↑='i') or (tty↑='I') then begin spoolit←false; get(tty); end;
1)	    if tty↑='/' then seen_slash←true else seen_slash←false;
1)	    end;
1)	reset(dvi_file,dvi_name,'/B:8/N:9/O');
1)	if (erstat(dvi_file) mod @'20000) > 0 then begin
1)		write(tty,'.DVI file? ');
1)		goto 223;
1)		end;
1)	cur_loc←0;
**** File 2) DVIIMP.CH[MF,ALS]/4P/11L
  1) DVIESP.CH[TEX,SYS] and 2) DVIIMP.CH[MF,ALS]	9-05-85 10:04	pages 5,4

2)	@y
2)	@p procedure open_dvi_file; {prepares to read packed bytes in |dvi_file|}
2)	begin reset(dvi_file,'','/B:8/N:9');
2)	cur_loc←0;
***************


**** File 1) DVIESP.CH[TEX,SYS]/5P/92L
1)	procedure open_tfm_file; {prepares to read packed bytes in |tfm_file|}
1)	begin reset(tfm_file,cur_tfm_name,'/B:8/O/N:9');
1)	cur_gf_loc←0;
1)	end;
1)	@z
**** File 2) DVIIMP.CH[MF,ALS]/4P/22L
2)	procedure cur_nam(var chan:f@&i@&l@&e;var s:string); extern; @t\2@>@/
2)	@z
***************


**** File 1) DVIESP.CH[TEX,SYS]/5P/104L
1)	label done;
1)	var i,j:integer;
1)	begin
1)	cur_nam(dvi_file,imp_name);
1)	i←1;
1)	while (imp_name[i]>'.') and (imp_name[i]≠'[') do
1)		incr(i); {skip to dot or bracket or space or null}
1)	if spoolit then begin
1)		j←i-1;
1)		imp_name[i]←'.'; incr(i);
1)		imp_name[i]←'L'; incr(i);
1)		imp_name[i]←'P'; incr(i);
1)		imp_name[i]←'T'; incr(i);
1)		imp_name[i]←'['; incr(i);
1)		imp_name[i]←'S'; incr(i);
1)		imp_name[i]←'P'; incr(i);
1)		imp_name[i]←'L'; incr(i);
1)		imp_name[i]←','; incr(i);
1)		imp_name[i]←'S'; incr(i);
1)		imp_name[i]←'Y'; incr(i);
1)		imp_name[i]←'S'; incr(i);
1)		imp_name[i]←']'; incr(i);
1)		while i<f_name_size do begin
1)			imp_name[i]←' ';
1)			incr(i);
1)			end;
1)		while true do begin
1)			reset(im_file,imp_name,'/O');
  1) DVIESP.CH[TEX,SYS] and 2) DVIIMP.CH[MF,ALS]	9-05-85 10:04	pages 5,4

1)			if (erstat(im_file) mod @'20000)>0 then goto done;
1)			imp_name[j]←chr(ord(imp_name[j])+1);
1)			if imp_name[j]>'Z' then begin
1)				imp_name[j-1]←chr(ord(imp_name[j-1])+1);
1)				imp_name[j]←'A';
1)				if imp_name[j-1]>'Z' then imp_name[j-1]←'A';
1)				end;
1)			end;
1)		done:
1)		end
1)	else begin
1)		imp_name[i]←'.'; incr(i);
1)		imp_name[i]←'I'; incr(i);
1)		imp_name[i]←'M'; incr(i);
1)		imp_name[i]←'P'; incr(i);
1)		while i<f_name_size do begin
1)			imp_name[i]←' ';
1)			incr(i);
1)			end;
1)		end;
1)	rewrite(im_file,imp_name,'/B:8/N:9/P:256');
1)	im_byte_no←0;
1)	end;
**** File 2) DVIIMP.CH[MF,ALS]/4P/31L
2)	begin rewrite(im_file,imp_name,'/B:8/N:9/P:256'); im_byte_no←0;
2)	end;
***************


**** File 1) DVIESP.CH[TEX,SYS]/7P/4L
1)	@d dflt_tfm_directory_name=='TeXfonts:' {change this to the correct name}
1)	@d dflt_tfm_directory_name_length=9 {change this to the correct length}
1)	@y
**** File 2) DVIIMP.CH[MF,ALS]/6P/4L
2)	@y
***************


**** File 1) DVIESP.CH[TEX,SYS]/7P/9L
1)	@d dflt_tfm_directory_name=='[TEX,SYS]' {change this to the correct name}
1)	@d dflt_tfm_directory_name_length=9 {change this to the correct length}
1)	@z
**** File 2) DVIIMP.CH[MF,ALS]/6P/7L
2)	@z
***************


**** File 1) DVIESP.CH[TEX,SYS]/8P/27L
  1) DVIESP.CH[TEX,SYS] and 2) DVIIMP.CH[MF,ALS]	9-05-85 10:04	pages 8,7

1)	cur_name[r+1]←'.'; cur_name[r+2]←'G'; cur_name[r+3]←'F';
1)	{|cur_name[r+4]←'M';|}
1)	@y
**** File 2) DVIIMP.CH[MF,ALS]/7P/27L
2)	cur_name[r+1]←'.'; cur_name[r+2]←'G'; cur_name[r+3]←'F'; {|cur_name[r+4]←'M';|}
2)	@y
***************


**** File 1) DVIESP.CH[TEX,SYS]/9P/1L
1)	@x Change to tfm file name conventions:
1)	@ Normally, we only need to reference the \.{GF} files.  On those
1)	occasions when no \.{GF} file is to be found we will want to obtain the
1)	glyph widths from a \.{TFM} file.
1)	The following module takes care of setting the external name of this
1)	\.{TFM} file.
1)	@<Move font name into the |cur_tfm_name| string@>=
1)	for k←1 to name_length do cur_tfm_name[k]←' ';
1)	if p=0 then
1)		begin for k←1 to dflt_tfm_directory_name_length do
1)			cur_tfm_name[k]←dflt_tfm_directory[k];
1)		r←dflt_tfm_directory_name_length;
1)		end
1)	else r←0;
1)	for k←font_name[cur_font] to font_name[cur_font+1]-1 do
1)		begin incr(r);
1)		if r+4>name_length then
1)			abort('DVIIMP capacity exceeded (max font name length=',
1)				name_length:1,')!');
1)	@.DVIIMP capacity exceeded...@>
1)		if (names[k]≥"a")∧(names[k]≤"z") then
1)				cur_tfm_name[k]←xchr[names[k]-@'40]
1)		else cur_tfm_name[r]←xchr[names[k]];
1)		end;
1)	cur_tfm_name[r+1]←'.'; cur_tfm_name[r+2]←'T';
1)	cur_tfm_name[r+3]←'F'; cur_tfm_name[r+4]←'M';
1)	@y
1)	@ Normally, we only need to reference the \.{GF} files.  On those
1)	occasions when no \.{GF} file is to be found we will want to obtain the
1)	glyph widths from a \.{TFM} file.
1)	The following takes care of {\mc SAIL} conventions.
1)	@<Move font name into the |cur_tfm_name| string@>=
1)	for k←1 to name_length do cur_tfm_name[k]←' ';
1)	r←0;
1)	for k←font_name[cur_font]+p to font_name[cur_font+1]-1 do
1)	    if (k≤font_name[cur_font]+p+2)∨(k≥font_name[cur_font+1]-3) then
1)		begin incr(r);
1)		if r+4>name_length then
  1) DVIESP.CH[TEX,SYS] and 2) DVIIMP.CH[MF,ALS]	9-05-85 10:04	pages 9,8

1)			abort('DVItype capacity exceeded (max font name length=',
1)				name_length:1,')!');
1)	@.DVItype capacity exceeded...@>
1)		if (names[k]≥"a")∧(names[k]≤"z") then
1)				cur_tfm_name[r]←xchr[names[k]-@'40]
1)		else cur_tfm_name[r]←xchr[names[k]];
1)		end;
1)	cur_tfm_name[r+1]←'.'; cur_tfm_name[r+2]←'T';
1)	cur_tfm_name[r+3]←'F'; cur_tfm_name[r+4]←'M';
1)	r←r+4;
1)	if p=0 then for k←1 to dflt_tfm_directory_name_length do
1)		begin incr(r);
1)		if r>name_length then abort('Font name is too long!');
1)		cur_tfm_name[r]←dflt_tfm_directory[k];
1)		end
1)	else for k←font_name[cur_font] to font_name[cur_font]+p-1 do
1)		begin incr(r);
1)		if r>name_length then abort('Font name is too long!');
1)		if (names[k]≥"a")∧(names[k]≤"z") then
1)				cur_tfm_name[r]←xchr[names[k]-@'40]
1)		else cur_tfm_name[r]←xchr[names[k]];
1)		end
1)	@z
1)	@x user and file id
**** File 2) DVIIMP.CH[MF,ALS]/8P/1L
2)	@x user and file id
***************


**** File 1) DVIESP.CH[TEX,SYS]/10P/16L
1)	im_byte("p");
1)	im_byte("a");
**** File 2) DVIIMP.CH[MF,ALS]/8P/15L
2)	im_byte("l");
2)	im_byte("a");
2)	im_byte("n");
2)	im_byte("g");
2)	im_byte("u");
2)	im_byte("a");
***************


**** File 1) DVIESP.CH[TEX,SYS]/10P/20L
1)	im_byte("r");
1)	im_byte("e");
1)	im_byte("v");
1)	im_byte("e");
1)	im_byte("r");
  1) DVIESP.CH[TEX,SYS] and 2) DVIIMP.CH[MF,ALS]	9-05-85 10:04	pages 10,8

1)	im_byte("s");
1)	im_byte("a");
1)	im_byte("l");
1)	im_byte(" ");
1)	im_byte("o");
1)	im_byte("f");
1)	im_byte("f");
1)	im_byte(",");
1)	im_byte(" ");
1)	im_byte("p");
1)	im_byte("a");
1)	im_byte("g");
1)	im_byte("e");
1)	im_byte("c");
1)	im_byte("o");
1)	im_byte("l");
1)	im_byte("l");
1)	im_byte("a");
1)	im_byte("t");
1)	im_byte("i");
1)	im_byte("o");
1)	im_byte("n");
1)	im_byte(" ");
1)	im_byte("o");
1)	im_byte("f");
1)	im_byte("f");
1)	im_byte(",");
1)	im_byte(" ");
1)	im_byte("l");
1)	im_byte("a");
1)	im_byte("n");
1)	im_byte("g");
1)	im_byte("u");
1)	im_byte("a");
1)	im_byte("g");
1)	im_byte("e");
1)	im_byte(" ");
**** File 2) DVIIMP.CH[MF,ALS]/8P/23L
2)	im_byte(" ");
***************


**** File 1) DVIESP.CH[TEX,SYS]/11P/1L
1)	@x esp
1)	final_end:end.
1)	@y
1)	final_end:
1)	close(im_file); close(dvi_file);
  1) DVIESP.CH[TEX,SYS] and 2) DVIIMP.CH[MF,ALS]	9-05-85 10:04	pages 11,8

1)	if spoolit then esp(dvi_file,im_file);
1)	end.
1)	@z
1)	@x file_name type
1)	itself will get a new section number.
1)	@↑system dependencies@>
1)	@y
1)	itself will get a new section number.
1)	@↑system dependencies@>
1)	@<Const...@>=
1)	@!f_name_size=24;
1)	@ @<Type...@>=
1)	@!file_name=packed array[1..f_name_size] of char;
1)	@ @<Glob...@>=
1)	@!imp_name,
1)	@!dvi_name:file_name;
1)	@!dvi_n_len:1..f_name_size;
1)		{file names at {\sc SAIL} have at most 23 characters}
1)	@!ppn:record case integer of
**** File 2) DVIIMP.CH[MF,ALS]/8P/70L
2)	@x
2)	@<Glob...@>=
2)	@y
2)	@<Glob...@>=
2)	@!dvi_name:packed array[1..24] of char;
2)	@!dvi_n_len:1..24; {file names at {\sc SAIL} have at most 23 characters}
2)	@!ppn:record case integer of
***************


**** File 1) DVIESP.CH[TEX,SYS]/12P/24L
1)	@!spoolit: boolean;
1)	@z
**** File 2) DVIIMP.CH[MF,ALS]/8P/81L
2)	@z
***************